package pers.course.week7;

import java.util.Scanner;

public class DivisorAndMultiple {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int num1 = in.nextInt();
        int num2 = in.nextInt();
        int gcd = gcd(num1, num2);
        System.out.println(gcd + " " + num1 * num2 / gcd);
    }
    private static int gcd(int a,int b) {
        return (b==0)?a:gcd(b,a%b);
    }
}
